public class Test {
    public static void main(String[] args) {
        int n = 1234;
        num(n);
    }
    public static void num(int n){
        if(n >= 9){
            num(n/10);
        }
        System.out.println(n % 10);
    }

}
